package com.bosssoft.enums;


/**
 * @Author: NieChangan
 * @Description: 返回码定义
 * 规定:
 * #200表示成功
 * #1001～1999 区间表示参数错误
 * #2001～2999 区间表示用户错误
 * #3001～3999 区间表示接口异常
 * #后面对什么的操作自己在这里注明就行了
 */
public enum ResultCode implements FibEnums {
    /* 成功 */
    SUCCESS(200, "成功"),

    /* 默认失败 */

    COMMON_FAIL(999, "失败"),

    /* 参数错误：1000～1999 */
    PARAM_NOT_VALID(1001, "参数无效"),
    PARAM_IS_BLANK(1002, "参数为空"),
    PARAM_TYPE_ERROR(1003, "参数类型错误"),
    PARAM_NOT_COMPLETE(1004, "参数缺失"),

    /* 用户错误 */
    USER_NOT_LOGIN(2001, "用户未登录"),
    USER_ACCOUNT_EXPIRED(2002, "账号已过期"),
    USER_CREDENTIALS_ERROR(2003, "密码错误"),
    USER_CREDENTIALS_EXPIRED(2004, "密码过期"),
    USER_ACCOUNT_DISABLE(2005, "账号不可用"),
    USER_ACCOUNT_LOCKED(2006, "账号被锁定"),
    USER_ACCOUNT_NOT_EXIST(2007, "账号不存在"),
    USER_ACCOUNT_ALREADY_EXIST(2008, "账号已存在"),
    USER_ACCOUNT_USE_BY_OTHERS(2009, "账号下线"),

    PRARM_IS_NULL(300,"传参有误,前端不讲码德"),
    ID_IS_NULL(301,"id为空,前端不讲码德"),

    /*学院错误*/
    COLLEGE_NOT_EXIST(2101, "学院不存在"),
    COLLEGE_ALREADY_EXIST(2102,"学院已存在"),

    /*班级错误*/


    /* 业务错误 */
    NO_PERMISSION(3001, "没有权限"),

    /*运行时异常*/

    CLAZZ_NOT_EXIST(2201, "班级不存在"),
    CLAZZ_ALREADY_EXIST(2202,"班级已存在"),
    CLAZZ_INSERT_ERROR(2210,"班级添加异常,稍后再试试吧"),
    CLAZZ_DELETE_ERROR(2211,"班级已被删除"),
    CLAZZ_UPDATE_ERROR(2212,"班级修改失败"),
    CLAZZ_COLLEGE_ID_NULL(2223,"班级模块,学院编号为空"),
    CLAZZ_COLLEGE_ID_ERROR(2224,"班级模块,学院编号有误"),
    CLAZZ_CLAZZ_ID_ERROR(2225,"班级模块,班级编号有误"),

    /*党支部错误*/
    DEPT_NOT_EXIST(2301, "党支部不存在"),
    DEPT_ALREADY_EXIST(2302,"党支部已存在"),
    DEPT_UPPER_NOT_EXIST(2303,"上级支部不存在"),

    /*管理员错误*/
    ADMIN_ACCOUNT_EXIST(2401,"管理员已存在"),
    ADMIN_PWD_NOT_ERROR(2402,"密码不能为空"),
    ADMIN_POWER_ERROR(2403,"权限错误"),
    ADMIN_ACCOUNT_ERROR(2404,"账号错误"),
    ADMIN_PASSWORD_ERROR(2405,"密码错误"),

    /*用户错误*/
    USER_NOT_EXIST(2501, "用户不存在"),
    USER_ALREADY_EXIST(2502,"用户已存在"),
    USER_ACCOUNT_ERROR(2503,"账号或密码错误"),
    USER_ACCOUNT_OLDPASSWORD_ERROR(2504,"旧密码错误"),
    USER_POWER_ERROR(2505,"用户权限不足"),

    /*问题错误*/
    QUESTION_NOT_EXIST(2601,"问题不存在"),
    QUESTION_ADD_ERROR(2602,"问题添加错误"),
    QUESTION_UPDATE_ERROR(2602,"问题添加错误"),

    /*试卷错误*/
    EXAMPAGE_RANDOM_ERROR(2705,"随机生成试卷失败"),


    /*答题卡错误*/
    ANSWER_INSERT_ERROR(2801,"答题卡添加错误"),
    ANSWER_DELETE_ERROR(2802,"答题卡删除错误"),
    ANSWER_UPDATE_ERROR(2803,"答题卡修改错误"),
    ANSWER_SELECT_ERROR(2804,"答题卡查询错误"),

    /*上传下载错误*/
    UPLOAD_ERROR(3001,"文件上传失败"),
    DOWNLOAD_ERROR(3101,"文件下载失败"),


    TOKEN_INIT_ERROR(4001,"Token生成失败"),
    TOKEN_TRANSFORM_ERROR(4002,"Token转换失败"),

    ARITHMETIC_EXCEPTION(9001,"算数异常");
    private int code;

    private String message;

    ResultCode(Integer code,String message){
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
